package com.example.hospital.config.sa_token;

import cn.dev33.satoken.stp.StpInterface;
import com.example.hospital.db.mapper.MisUserMapper;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

@Component
public class StpInterfaceImpl implements StpInterface {
  @Resource
  private MisUserMapper misUserMapper;
  
  
  /**
   * 返回一个用户所拥有的权限集合
   */
  @Override
  public List <String> getPermissionList(Object loginId, String loginKey) {
    int userId = Integer.parseInt(loginId.toString());
    return misUserMapper.searchUserPermissions(userId);
  }
  
  
  /**
   * 返回一个用户所拥有的角色标识集合
   */
  @Override
  public List <String> getRoleList(Object loginId, String loginKey) {
    ArrayList <String> list = new ArrayList();
    return list;
  }
  
}